{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Importing PulP solver\n",
    "from pulp import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Demand points\n",
    "demand_points=['Port of Haifa','Port of King Abdul Aziz','Port of Jebel Ali']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Port of Haifa', 'Port of King Abdul Aziz', 'Port of Jebel Ali']"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "demand_points"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Supply Points\n",
    "supply_points=['Port of Santos','Sihanoukville','Douala','Port of Shanghai','Puerto Quetzal','Port of Jawaharlal Nehru','Port of Tanjung Priok','Port of Abidjan','Port of Monrovia','Penang Port','Port of Manzanillo','Port of Yangon','Port of Lagos','Port of Manila','Port of  Colombo','Port of Bangkok','Port of Saigon']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Port of Santos',\n",
       " 'Sihanoukville',\n",
       " 'Douala',\n",
       " 'Port of Shanghai',\n",
       " 'Puerto Quetzal',\n",
       " 'Port of Jawaharlal Nehru',\n",
       " 'Port of Tanjung Priok',\n",
       " 'Port of Abidjan',\n",
       " 'Port of Monrovia',\n",
       " 'Penang Port',\n",
       " 'Port of Manzanillo',\n",
       " 'Port of Yangon',\n",
       " 'Port of Lagos',\n",
       " 'Port of Manila',\n",
       " 'Port of  Colombo',\n",
       " 'Port of Bangkok',\n",
       " 'Port of Saigon']"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "supply_points"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the distances\n",
    "distance = dict(zip(supply_points,[dict(zip(demand_points, [7667,9716,9407])),\n",
    "dict(zip(demand_points, [6321,4908,4613])),\n",
    "dict(zip(demand_points, [6011,8325,8017])),\n",
    "dict(zip(demand_points, [8336,6922,6627])),\n",
    "dict(zip(demand_points, [8820,12259,11949])),\n",
    "dict(zip(demand_points, [3510,1630,1335])),\n",
    "dict(zip(demand_points, [6000,4700,4405])),\n",
    "dict(zip(demand_points, [5211,8877,8568])),\n",
    "dict(zip(demand_points, [4816,8259,7951])),\n",
    "dict(zip(demand_points, [5310,3896,3601])),\n",
    "dict(zip(demand_points, [9673,13099,12790])),\n",
    "dict(zip(demand_points, [5434,3982,3687])),\n",
    "dict(zip(demand_points, [5662,8624,8316])),\n",
    "dict(zip(demand_points, [7248,5834,5539])),\n",
    "dict(zip(demand_points, [4010,2572,2276])),\n",
    "dict(zip(demand_points, [6556,5142,4847])),\n",
    "dict(zip(demand_points, [6418,5004,4709]))]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Santos': {'Port of Haifa': 7667,\n",
       "  'Port of King Abdul Aziz': 9716,\n",
       "  'Port of Jebel Ali': 9407},\n",
       " 'Sihanoukville': {'Port of Haifa': 6321,\n",
       "  'Port of King Abdul Aziz': 4908,\n",
       "  'Port of Jebel Ali': 4613},\n",
       " 'Douala': {'Port of Haifa': 6011,\n",
       "  'Port of King Abdul Aziz': 8325,\n",
       "  'Port of Jebel Ali': 8017},\n",
       " 'Port of Shanghai': {'Port of Haifa': 8336,\n",
       "  'Port of King Abdul Aziz': 6922,\n",
       "  'Port of Jebel Ali': 6627},\n",
       " 'Puerto Quetzal': {'Port of Haifa': 8820,\n",
       "  'Port of King Abdul Aziz': 12259,\n",
       "  'Port of Jebel Ali': 11949},\n",
       " 'Port of Jawaharlal Nehru': {'Port of Haifa': 3510,\n",
       "  'Port of King Abdul Aziz': 1630,\n",
       "  'Port of Jebel Ali': 1335},\n",
       " 'Port of Tanjung Priok': {'Port of Haifa': 6000,\n",
       "  'Port of King Abdul Aziz': 4700,\n",
       "  'Port of Jebel Ali': 4405},\n",
       " 'Port of Abidjan': {'Port of Haifa': 5211,\n",
       "  'Port of King Abdul Aziz': 8877,\n",
       "  'Port of Jebel Ali': 8568},\n",
       " 'Port of Monrovia': {'Port of Haifa': 4816,\n",
       "  'Port of King Abdul Aziz': 8259,\n",
       "  'Port of Jebel Ali': 7951},\n",
       " 'Penang Port': {'Port of Haifa': 5310,\n",
       "  'Port of King Abdul Aziz': 3896,\n",
       "  'Port of Jebel Ali': 3601},\n",
       " 'Port of Manzanillo': {'Port of Haifa': 9673,\n",
       "  'Port of King Abdul Aziz': 13099,\n",
       "  'Port of Jebel Ali': 12790},\n",
       " 'Port of Yangon': {'Port of Haifa': 5434,\n",
       "  'Port of King Abdul Aziz': 3982,\n",
       "  'Port of Jebel Ali': 3687},\n",
       " 'Port of Lagos': {'Port of Haifa': 5662,\n",
       "  'Port of King Abdul Aziz': 8624,\n",
       "  'Port of Jebel Ali': 8316},\n",
       " 'Port of Manila': {'Port of Haifa': 7248,\n",
       "  'Port of King Abdul Aziz': 5834,\n",
       "  'Port of Jebel Ali': 5539},\n",
       " 'Port of  Colombo': {'Port of Haifa': 4010,\n",
       "  'Port of King Abdul Aziz': 2572,\n",
       "  'Port of Jebel Ali': 2276},\n",
       " 'Port of Bangkok': {'Port of Haifa': 6556,\n",
       "  'Port of King Abdul Aziz': 5142,\n",
       "  'Port of Jebel Ali': 4847},\n",
       " 'Port of Saigon': {'Port of Haifa': 6418,\n",
       "  'Port of King Abdul Aziz': 5004,\n",
       "  'Port of Jebel Ali': 4709}}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "distance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Rubber Demand\n",
    "rubber_demand=dict(zip(demand_points, [47500474.23,54769494.56,52000489.97]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Haifa': 47500474.23,\n",
       " 'Port of King Abdul Aziz': 54769494.56,\n",
       " 'Port of Jebel Ali': 52000489.97}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rubber_demand"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Rubber Supply\n",
    "rubber_supply=dict(zip(supply_points, [1258648.2900,8234049.7510,217343.9060,8784079.7960,3935392.5450,6522791.1570,34239646.0300,3411326.1430,603911.1280,5312726.1900,330881.7674,1946363.3380,1386711.0420,2541650.1950,741564.4317,49185954.9800,25617418.0800])) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Santos': 1258648.29,\n",
       " 'Sihanoukville': 8234049.751,\n",
       " 'Douala': 217343.906,\n",
       " 'Port of Shanghai': 8784079.796,\n",
       " 'Puerto Quetzal': 3935392.545,\n",
       " 'Port of Jawaharlal Nehru': 6522791.157,\n",
       " 'Port of Tanjung Priok': 34239646.03,\n",
       " 'Port of Abidjan': 3411326.143,\n",
       " 'Port of Monrovia': 603911.128,\n",
       " 'Penang Port': 5312726.19,\n",
       " 'Port of Manzanillo': 330881.7674,\n",
       " 'Port of Yangon': 1946363.338,\n",
       " 'Port of Lagos': 1386711.042,\n",
       " 'Port of Manila': 2541650.195,\n",
       " 'Port of  Colombo': 741564.4317,\n",
       " 'Port of Bangkok': 49185954.98,\n",
       " 'Port of Saigon': 25617418.08}"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rubber_supply"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set Problem Variables\n",
    "prob = LpProblem(\"Transportation\", LpMinimize)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "None\n",
       "VARIABLES"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set Problem Variables\n",
    "routes = [(i,j) for i in supply_points for j in demand_points]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('Port of Santos', 'Port of Haifa'),\n",
       " ('Port of Santos', 'Port of King Abdul Aziz'),\n",
       " ('Port of Santos', 'Port of Jebel Ali'),\n",
       " ('Sihanoukville', 'Port of Haifa'),\n",
       " ('Sihanoukville', 'Port of King Abdul Aziz'),\n",
       " ('Sihanoukville', 'Port of Jebel Ali'),\n",
       " ('Douala', 'Port of Haifa'),\n",
       " ('Douala', 'Port of King Abdul Aziz'),\n",
       " ('Douala', 'Port of Jebel Ali'),\n",
       " ('Port of Shanghai', 'Port of Haifa'),\n",
       " ('Port of Shanghai', 'Port of King Abdul Aziz'),\n",
       " ('Port of Shanghai', 'Port of Jebel Ali'),\n",
       " ('Puerto Quetzal', 'Port of Haifa'),\n",
       " ('Puerto Quetzal', 'Port of King Abdul Aziz'),\n",
       " ('Puerto Quetzal', 'Port of Jebel Ali'),\n",
       " ('Port of Jawaharlal Nehru', 'Port of Haifa'),\n",
       " ('Port of Jawaharlal Nehru', 'Port of King Abdul Aziz'),\n",
       " ('Port of Jawaharlal Nehru', 'Port of Jebel Ali'),\n",
       " ('Port of Tanjung Priok', 'Port of Haifa'),\n",
       " ('Port of Tanjung Priok', 'Port of King Abdul Aziz'),\n",
       " ('Port of Tanjung Priok', 'Port of Jebel Ali'),\n",
       " ('Port of Abidjan', 'Port of Haifa'),\n",
       " ('Port of Abidjan', 'Port of King Abdul Aziz'),\n",
       " ('Port of Abidjan', 'Port of Jebel Ali'),\n",
       " ('Port of Monrovia', 'Port of Haifa'),\n",
       " ('Port of Monrovia', 'Port of King Abdul Aziz'),\n",
       " ('Port of Monrovia', 'Port of Jebel Ali'),\n",
       " ('Penang Port', 'Port of Haifa'),\n",
       " ('Penang Port', 'Port of King Abdul Aziz'),\n",
       " ('Penang Port', 'Port of Jebel Ali'),\n",
       " ('Port of Manzanillo', 'Port of Haifa'),\n",
       " ('Port of Manzanillo', 'Port of King Abdul Aziz'),\n",
       " ('Port of Manzanillo', 'Port of Jebel Ali'),\n",
       " ('Port of Yangon', 'Port of Haifa'),\n",
       " ('Port of Yangon', 'Port of King Abdul Aziz'),\n",
       " ('Port of Yangon', 'Port of Jebel Ali'),\n",
       " ('Port of Lagos', 'Port of Haifa'),\n",
       " ('Port of Lagos', 'Port of King Abdul Aziz'),\n",
       " ('Port of Lagos', 'Port of Jebel Ali'),\n",
       " ('Port of Manila', 'Port of Haifa'),\n",
       " ('Port of Manila', 'Port of King Abdul Aziz'),\n",
       " ('Port of Manila', 'Port of Jebel Ali'),\n",
       " ('Port of  Colombo', 'Port of Haifa'),\n",
       " ('Port of  Colombo', 'Port of King Abdul Aziz'),\n",
       " ('Port of  Colombo', 'Port of Jebel Ali'),\n",
       " ('Port of Bangkok', 'Port of Haifa'),\n",
       " ('Port of Bangkok', 'Port of King Abdul Aziz'),\n",
       " ('Port of Bangkok', 'Port of Jebel Ali'),\n",
       " ('Port of Saigon', 'Port of Haifa'),\n",
       " ('Port of Saigon', 'Port of King Abdul Aziz'),\n",
       " ('Port of Saigon', 'Port of Jebel Ali')]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "routes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Decision Variables\n",
    "X = LpVariable.dicts(\"ShipmentAmount\",(supply_points, demand_points),0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Santos': {'Port of Haifa': ShipmentAmount_Port_of_Santos_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali},\n",
       " 'Sihanoukville': {'Port of Haifa': ShipmentAmount_Sihanoukville_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali},\n",
       " 'Douala': {'Port of Haifa': ShipmentAmount_Douala_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Douala_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Douala_Port_of_Jebel_Ali},\n",
       " 'Port of Shanghai': {'Port of Haifa': ShipmentAmount_Port_of_Shanghai_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali},\n",
       " 'Puerto Quetzal': {'Port of Haifa': ShipmentAmount_Puerto_Quetzal_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali},\n",
       " 'Port of Jawaharlal Nehru': {'Port of Haifa': ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali},\n",
       " 'Port of Tanjung Priok': {'Port of Haifa': ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali},\n",
       " 'Port of Abidjan': {'Port of Haifa': ShipmentAmount_Port_of_Abidjan_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali},\n",
       " 'Port of Monrovia': {'Port of Haifa': ShipmentAmount_Port_of_Monrovia_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali},\n",
       " 'Penang Port': {'Port of Haifa': ShipmentAmount_Penang_Port_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Penang_Port_Port_of_Jebel_Ali},\n",
       " 'Port of Manzanillo': {'Port of Haifa': ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali},\n",
       " 'Port of Yangon': {'Port of Haifa': ShipmentAmount_Port_of_Yangon_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali},\n",
       " 'Port of Lagos': {'Port of Haifa': ShipmentAmount_Port_of_Lagos_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali},\n",
       " 'Port of Manila': {'Port of Haifa': ShipmentAmount_Port_of_Manila_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali},\n",
       " 'Port of  Colombo': {'Port of Haifa': ShipmentAmount_Port_of__Colombo_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali},\n",
       " 'Port of Bangkok': {'Port of Haifa': ShipmentAmount_Port_of_Bangkok_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali},\n",
       " 'Port of Saigon': {'Port of Haifa': ShipmentAmount_Port_of_Saigon_Port_of_Haifa,\n",
       "  'Port of King Abdul Aziz': ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali}}"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Objective Function\n",
    "prob += sum(X[i][j]*distance[i][j] for (i,j) in routes)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "6011*ShipmentAmount_Douala_Port_of_Haifa + 8017*ShipmentAmount_Douala_Port_of_Jebel_Ali + 8325*ShipmentAmount_Douala_Port_of_King_Abdul_Aziz + 5310*ShipmentAmount_Penang_Port_Port_of_Haifa + 3601*ShipmentAmount_Penang_Port_Port_of_Jebel_Ali + 3896*ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz + 5211*ShipmentAmount_Port_of_Abidjan_Port_of_Haifa + 8568*ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali + 8877*ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz + 6556*ShipmentAmount_Port_of_Bangkok_Port_of_Haifa + 4847*ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali + 5142*ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz + 3510*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa + 1335*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali + 1630*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz + 5662*ShipmentAmount_Port_of_Lagos_Port_of_Haifa + 8316*ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali + 8624*ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz + 7248*ShipmentAmount_Port_of_Manila_Port_of_Haifa + 5539*ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali + 5834*ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz + 9673*ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa + 12790*ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali + 13099*ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz + 4816*ShipmentAmount_Port_of_Monrovia_Port_of_Haifa + 7951*ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali + 8259*ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz + 6418*ShipmentAmount_Port_of_Saigon_Port_of_Haifa + 4709*ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali + 5004*ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz + 7667*ShipmentAmount_Port_of_Santos_Port_of_Haifa + 9407*ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali + 9716*ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz + 8336*ShipmentAmount_Port_of_Shanghai_Port_of_Haifa + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6922*ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz + 6000*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Haifa + 4405*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali + 4700*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz + 5434*ShipmentAmount_Port_of_Yangon_Port_of_Haifa + 3687*ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali + 3982*ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz + 4010*ShipmentAmount_Port_of__Colombo_Port_of_Haifa + 2276*ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali + 2572*ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz + 8820*ShipmentAmount_Puerto_Quetzal_Port_of_Haifa + 11949*ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali + 12259*ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz + 6321*ShipmentAmount_Sihanoukville_Port_of_Haifa + 4613*ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali + 4908*ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz + 0\n",
       "VARIABLES\n",
       "ShipmentAmount_Douala_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Douala_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Douala_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz Continuous"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "6011*ShipmentAmount_Douala_Port_of_Haifa + 8017*ShipmentAmount_Douala_Port_of_Jebel_Ali + 8325*ShipmentAmount_Douala_Port_of_King_Abdul_Aziz + 5310*ShipmentAmount_Penang_Port_Port_of_Haifa + 3601*ShipmentAmount_Penang_Port_Port_of_Jebel_Ali + 3896*ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz + 5211*ShipmentAmount_Port_of_Abidjan_Port_of_Haifa + 8568*ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali + 8877*ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz + 6556*ShipmentAmount_Port_of_Bangkok_Port_of_Haifa + 4847*ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali + 5142*ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz + 3510*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa + 1335*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali + 1630*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz + 5662*ShipmentAmount_Port_of_Lagos_Port_of_Haifa + 8316*ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali + 8624*ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz + 7248*ShipmentAmount_Port_of_Manila_Port_of_Haifa + 5539*ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali + 5834*ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz + 9673*ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa + 12790*ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali + 13099*ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz + 4816*ShipmentAmount_Port_of_Monrovia_Port_of_Haifa + 7951*ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali + 8259*ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz + 6418*ShipmentAmount_Port_of_Saigon_Port_of_Haifa + 4709*ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali + 5004*ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz + 7667*ShipmentAmount_Port_of_Santos_Port_of_Haifa + 9407*ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali + 9716*ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz + 8336*ShipmentAmount_Port_of_Shanghai_Port_of_Haifa + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6922*ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz + 6000*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Haifa + 4405*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali + 4700*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz + 5434*ShipmentAmount_Port_of_Yangon_Port_of_Haifa + 3687*ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali + 3982*ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz + 4010*ShipmentAmount_Port_of__Colombo_Port_of_Haifa + 2276*ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali + 2572*ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz + 8820*ShipmentAmount_Puerto_Quetzal_Port_of_Haifa + 11949*ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali + 12259*ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz + 6321*ShipmentAmount_Sihanoukville_Port_of_Haifa + 4613*ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali + 4908*ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz + 0\n",
       "SUBJECT TO\n",
       "_C1: ShipmentAmount_Douala_Port_of_Haifa\n",
       " + ShipmentAmount_Penang_Port_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Haifa\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Haifa\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Haifa >= 47500474.23\n",
       "\n",
       "_C2: ShipmentAmount_Douala_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz >= 54769494.56\n",
       "\n",
       "_C3: ShipmentAmount_Douala_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Penang_Port_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali >= 52000489.97\n",
       "\n",
       "VARIABLES\n",
       "ShipmentAmount_Douala_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Douala_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Douala_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz Continuous"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Constraints\n",
    "for j in demand_points:\n",
    "    prob += sum(X[i][j] for i in supply_points) >= rubber_demand[j]\n",
    "    \n",
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "6011*ShipmentAmount_Douala_Port_of_Haifa + 8017*ShipmentAmount_Douala_Port_of_Jebel_Ali + 8325*ShipmentAmount_Douala_Port_of_King_Abdul_Aziz + 5310*ShipmentAmount_Penang_Port_Port_of_Haifa + 3601*ShipmentAmount_Penang_Port_Port_of_Jebel_Ali + 3896*ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz + 5211*ShipmentAmount_Port_of_Abidjan_Port_of_Haifa + 8568*ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali + 8877*ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz + 6556*ShipmentAmount_Port_of_Bangkok_Port_of_Haifa + 4847*ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali + 5142*ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz + 3510*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa + 1335*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali + 1630*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz + 5662*ShipmentAmount_Port_of_Lagos_Port_of_Haifa + 8316*ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali + 8624*ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz + 7248*ShipmentAmount_Port_of_Manila_Port_of_Haifa + 5539*ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali + 5834*ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz + 9673*ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa + 12790*ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali + 13099*ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz + 4816*ShipmentAmount_Port_of_Monrovia_Port_of_Haifa + 7951*ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali + 8259*ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz + 6418*ShipmentAmount_Port_of_Saigon_Port_of_Haifa + 4709*ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali + 5004*ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz + 7667*ShipmentAmount_Port_of_Santos_Port_of_Haifa + 9407*ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali + 9716*ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz + 8336*ShipmentAmount_Port_of_Shanghai_Port_of_Haifa + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6922*ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz + 6000*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Haifa + 4405*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali + 4700*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz + 5434*ShipmentAmount_Port_of_Yangon_Port_of_Haifa + 3687*ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali + 3982*ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz + 4010*ShipmentAmount_Port_of__Colombo_Port_of_Haifa + 2276*ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali + 2572*ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz + 8820*ShipmentAmount_Puerto_Quetzal_Port_of_Haifa + 11949*ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali + 12259*ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz + 6321*ShipmentAmount_Sihanoukville_Port_of_Haifa + 4613*ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali + 4908*ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz + 0\n",
       "SUBJECT TO\n",
       "_C1: ShipmentAmount_Douala_Port_of_Haifa\n",
       " + ShipmentAmount_Penang_Port_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Haifa\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Haifa\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Haifa >= 47500474.23\n",
       "\n",
       "_C2: ShipmentAmount_Douala_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz >= 54769494.56\n",
       "\n",
       "_C3: ShipmentAmount_Douala_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Penang_Port_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali >= 52000489.97\n",
       "\n",
       "_C4: ShipmentAmount_Port_of_Santos_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz = 1258648.29\n",
       "\n",
       "_C5: ShipmentAmount_Sihanoukville_Port_of_Haifa\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz = 8234049.751\n",
       "\n",
       "_C6: ShipmentAmount_Douala_Port_of_Haifa\n",
       " + ShipmentAmount_Douala_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Douala_Port_of_King_Abdul_Aziz = 217343.906\n",
       "\n",
       "_C7: ShipmentAmount_Port_of_Shanghai_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz = 8784079.796\n",
       "\n",
       "_C8: ShipmentAmount_Puerto_Quetzal_Port_of_Haifa\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz = 3935392.545\n",
       "\n",
       "_C9: ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz\n",
       " = 6522791.157\n",
       "\n",
       "_C10: ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz = 34239646.03\n",
       "\n",
       "_C11: ShipmentAmount_Port_of_Abidjan_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz = 3411326.143\n",
       "\n",
       "_C12: ShipmentAmount_Port_of_Monrovia_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz = 603911.128\n",
       "\n",
       "_C13: ShipmentAmount_Penang_Port_Port_of_Haifa\n",
       " + ShipmentAmount_Penang_Port_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz = 5312726.19\n",
       "\n",
       "_C14: ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz = 330881.7674\n",
       "\n",
       "_C15: ShipmentAmount_Port_of_Yangon_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz = 1946363.338\n",
       "\n",
       "_C16: ShipmentAmount_Port_of_Lagos_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz = 1386711.042\n",
       "\n",
       "_C17: ShipmentAmount_Port_of_Manila_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz = 2541650.195\n",
       "\n",
       "_C18: ShipmentAmount_Port_of__Colombo_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz = 741564.4317\n",
       "\n",
       "_C19: ShipmentAmount_Port_of_Bangkok_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz = 49185954.98\n",
       "\n",
       "_C20: ShipmentAmount_Port_of_Saigon_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz = 25617418.08\n",
       "\n",
       "VARIABLES\n",
       "ShipmentAmount_Douala_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Douala_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Douala_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz Continuous"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Constraints\n",
    "for i in supply_points:\n",
    "    prob += sum(X[i][j] for j in demand_points) == rubber_supply[i]\n",
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Status: Optimal\n",
      "ShipmentAmount_Douala_Port_of_Haifa = 217343.91\n",
      "ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz = 5312726.2\n",
      "ShipmentAmount_Port_of_Abidjan_Port_of_Haifa = 3411326.1\n",
      "ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali = 6251977.8\n",
      "ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz = 42933977.0\n",
      "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz = 6522791.2\n",
      "ShipmentAmount_Port_of_Lagos_Port_of_Haifa = 1386711.0\n",
      "ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali = 2541650.2\n",
      "ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa = 330881.77\n",
      "ShipmentAmount_Port_of_Monrovia_Port_of_Haifa = 603911.13\n",
      "ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali = 25617418.0\n",
      "ShipmentAmount_Port_of_Santos_Port_of_Haifa = 1258648.3\n",
      "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali = 8784079.8\n",
      "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Haifa = 34239646.0\n",
      "ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali = 1946363.3\n",
      "ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali = 741564.43\n",
      "ShipmentAmount_Puerto_Quetzal_Port_of_Haifa = 3935392.5\n",
      "ShipmentAmount_Sihanoukville_Port_of_Haifa = 2116613.4\n",
      "ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali = 6117436.4\n",
      "Total kilogram_miles = 808627567222.08\n"
     ]
    }
   ],
   "source": [
    "prob.solve()\n",
    "\n",
    "print(\"Status:\", LpStatus[prob.status])\n",
    "\n",
    "for v in prob.variables():\n",
    "    if v.varValue > 0:\n",
    "        print(v.name, \"=\", v.varValue)\n",
    "\n",
    "print(\"Total kilogram_miles =\", value(prob.objective))\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
